home *** CD-ROM | disk | FTP | other *** search
/ Technotools / Technotools (Chestnut CD-ROM)(1993).ISO / lang_c / cug232 / drive.h < prev    next >
Text File  |  1987-06-17  |  2KB  |  64 lines

  1. /*
  2.     Little Smalltalk
  3.  
  4.         defines used by both parser and driver
  5.  
  6. */
  7.  
  8. # define TWOBIT         0
  9. # define PUSHINSTANCE   1
  10. # define PUSHTEMP       2
  11. # define PUSHLIT        3
  12. # define PUSHCLASS      4
  13. # define PUSHSPECIAL    5
  14. # define POPINSTANCE    6
  15. # define POPTEMP        7
  16. # define SEND           8
  17. # define SUPERSEND      9
  18. # define UNSEND        10
  19. # define BINSEND       11
  20. # define ARITHSEND     12
  21. # define KEYSEND       13
  22. # define BLOCKCREATE   14
  23. # define SPECIAL       15
  24.  
  25. /* arguments for special */
  26.  
  27. # define NOOP           0
  28. # define DUPSTACK       1
  29. # define POPSTACK       2
  30. # define RETURN         3
  31. # define BLOCKRETURN    4
  32. # define SELFRETURN     5
  33. # define SKIPTRUEPUSH   6
  34. # define SKIPFALSEPUSH  7
  35. # define SKIPFORWARD    8
  36. # define SKIPBACK       9
  37. # define PRIMCMD       10
  38. # define SKIPT         11
  39. # define SKIPF         12
  40.  
  41. enum pseuvars {nilvar, truevar, falsevar, selfvar, supervar, smallvar,
  42.         procvar};
  43.  
  44. # define streq(a,b) (strcmp(a,b) == 0)
  45.  
  46. /* only include driver code in driver, keeps both lint and the 11/70 quiet */
  47. # ifdef DRIVECODE
  48.  
  49.  enum lextokens { nothing, LITNUM , LITFNUM , LITCHAR , LITSTR , LITSYM ,
  50.     LITARR , LITBYTE , ASSIGN , BINARY , PRIMITIVE , PSEUDO ,
  51.     UPPERCASEVAR , LOWERCASEVAR , COLONVAR , KEYWORD ,
  52.      LP , RP , LB , RB , PERIOD , BAR , SEMI , PS , MINUS , PE , NL };
  53.  
  54. typedef union  {
  55.     char         *c;
  56.     double          f;
  57.     int           i;
  58.     enum pseuvars      p;
  59.     } tok_type;
  60.  
  61. extern tok_type t;
  62.  
  63. # endif
  64.